#include "Person.h"

#include <memory>


void test1()
{
    Child c1;
    Parent* pP = NULL;
    Child* pC = NULL;
    Child array[] = {Child(1), Child(2)};
    pP = array;
    pC = array;

    pP->print(); //#1
    pC->print();

    pP++;
    pC++;
    pP->print(); // #2
    pC->print();


    std::cout << " exit success ";
}

void test0()
{
    Child* c;
    {
        Child c1;
    }

    {
        Child c2;
    }
    {
        c = new Child();
    }
    cout << "exit main    " << endl;
    delete c;

}

void test2()
{
    auto shared = std::make_shared<Child>();
    shared->print();
    shared->print();
}

int main()
{

    test2();
    return 0;
}
